import axios from 'axios'
    /*axios 的并发用法*/ 

    // 获取城市信息而已
  function getFilm(filmId) {
    // 5669
    return axios({
       url:"https://m.maizuo.com/gateway?k=3641237&filmId="+filmId,
       methods:"get",
       headers:{
        "X-Host":" mall.film-ticket.film.info",
        "X-Client-Info":`{"a":"3000","ch":"1002","v":"5.0.4","e":"1633053413552375743938561","bc":"440100"}`
       }
    })
  }
  // 获取当前城市的排班id
  function getshowNow(filmId,cityId) {
    return axios({
      url:"https://m.maizuo.com/gateway/?k=1013530&filmId="+filmId+"&cityId="+cityId,
      methods:"get",
      headers:{
      "X-Host": "mall.film-ticket.cinema.film-show-cinema",
      "X-Client-Info":`{"a":"3000","ch":"1002","v":"5.0.4","e":"1633053413552375743938561","bc":"440100"}`
      }
    })
  }



export  function axiosAll(filmId,cityId){
   return axios.all([getFilm(filmId), getshowNow(filmId,cityId)])
}


// 获取排班id下的list列表
export function cinemaNowShow(cinemaIds,cityId){
  return axios({
      method: "post",
      url: "https://m.maizuo.com/gateway?k=2326092",
      headers:{
          "X-Host":`mall.film-ticket.cinema.batch-cinema`,
          "X-Client-Info":`{"a":"3000","ch":"1002","v":"5.0.4","e":"1633053413552375743938561","bc":"440100"}`
      },
      data: {
        /*这个影院的数值其实需要转成字符串的*/ 
        cinemaIds: cinemaIds.join(","),
        cityId: cityId,
      }
  })


}